Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal length As Long)
Private Declare Function SetDIBitsToDevice Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal Scan As Long, ByVal NumScans As Long, Bits As Any, BitsInfo As Any, ByVal wUsage As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetDIBits Lib "gdi32" (ByVal aHDC As Long, ByVal hBitmap As Long, ByVal nStartScan As Long, ByVal nNumScans As Long, lpBits As Any, lpBI As Any, ByVal wUsage As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Sub FillMemory Lib "kernel32.dll" Alias "RtlFillMemory" (Destination As Any, ByVal length As Long, ByVal Fill As Byte)
Private Type BITMAPINFOHEADER
Size As Long
Width As Long
Height As Long
Planes As Integer
BitCount As Integer
Compression As Long
SizeImage As Long
XPelsPerMeter As Long
YPelsPerMeter As Long
ClrUsed As Long
ClrImportant As Long
End Type
Private RBD As Long
Private IDATData() As Byte
Dim IdataLen As Long
Private Type IHDR
Width As Long
Height As Long
BitDepth As Byte
ColorType As Byte
Compression As Byte
Filter As Byte
Interlacing As Byte
End Type
'For Decompression:
Private Type CodesType
Lenght() As Long
code() As Long
End Type
Private m_Backcolor As Long
Private Palettenbyte() As Byte
Private OutStream() As Byte
Private OutPos As Long
Private InStream() As Byte
Private Inpos As Long
Private ByteBuff As Long
Private BitNum As Long
Private BitMask(16) As Long
Private Pow2(16) As Long
Private LC As CodesType
Private dc As CodesType
Private LitLen As CodesType
Private Dist As CodesType
Private TempLit As CodesType
Private TempDist As CodesType
Private LenOrder(18) As Long
Private MinLLenght As Long
Private MaxLLenght As Long
Private MinDLenght As Long
Private MaxDLenght As Long
Private IsStaticBuild As Boolean
Private BPPprivat As Long
Private m_width As Long
Private m_height As Long
Private m_bitdepht As Long
Private m_colortype As Long
Private m_compression As Long
Private m_filter As Long
Private m_interlacing As Long
Private m_ErrorNumber As Long
Private m_sAlpha As Boolean
Private m_hAlpha As Boolean
Private trns() As Byte
Private m_hTrans As Boolean
Private m_sTrans As Boolean
Private Colorused As Long
Private bkgd() As Byte
Private m_hbkgd As Boolean
Private m_bkgdColor As Long
Private m_text As String
Private m_Time As String
Private m_ztext As String
Private m_gama As Long
Private m_Bgx As Long
Private m_Bgy As Long
Private m_BGPic As Object
Private m_OwnBkgnd As Boolean
Private m_OBCol As Long
Private m_PicBox As Object
Private m_settoBG As Boolean
Public Function OpenPNG(filename As String) As Long
Private Sub BytesToBits(Bytefeld() As Byte, Bitanzahl As Byte, Gr÷▀e As Long)
Dim i As Long
Dim ▄bergabe() As Byte
Dim Wandeln() As Byte
Dim EinGr As Long
Dim z As Long
EinGr = UBound(Bytefeld) + 1
Select Case Bitanzahl
Case 1
ReDim ▄bergabe((EinGr * 8) - 1)
For i = 0 To EinGr - 1
ByteToEinBit Bytefeld(i), Wandeln
CopyMemory ▄bergabe(z), Wandeln(0), 8
z = z + 8
Next i
Case 2
ReDim ▄bergabe((EinGr * 4) - 1)
For i = 0 To EinGr - 1
ByteToZweiBit Bytefeld(i), Wandeln
CopyMemory ▄bergabe(z), Wandeln(0), 4
z = z + 4
Next i
Case 4
ReDim ▄bergabe((EinGr * 2) - 1)
For i = 0 To EinGr - 1
ByteToVierBit Bytefeld(i), Wandeln
CopyMemory ▄bergabe(z), Wandeln(0), 2
z = z + 2
Next i
End Select
ReDim Preserve ▄bergabe(Gr÷▀e - 1)
Bytefeld = ▄bergabe
End Sub
Private Sub ByteToZweiBit(Number As Byte, Wandeln() As Byte)
Dim a As Byte
ReDim Wandeln(3)
Wandeln(3) = Number And 3
a = Number And 12
Wandeln(2) = a / 4
a = Number And 48
Wandeln(1) = a / 16
a = Number And 192
Wandeln(0) = a / 64
End Sub
Private Sub ByteToEinBit(Number As Byte, Wandeln() As Byte)
Dim a As Byte
ReDim Wandeln(7)
Wandeln(7) = Number And 1
a = Number And 2
Wandeln(6) = a / 2
a = Number And 4
Wandeln(5) = a / 4
a = Number And 8
Wandeln(4) = a / 8
a = Number And 16
Wandeln(3) = a / 16
a = Number And 32
Wandeln(2) = a / 3(6) = a / 2
a = N
Wanter Zeilenbuffer hdeln(2) = an4
WaAB3 W,ber As Br Ap And 3
a = Number And 12g07) = Nu13 48
Wandel=aAB3 W,ber A4 = Nu13 48
W(Left) + CInt(Above) f Le
WaAB3 W,ber As Br Ap And 3
a iandeln(2) = +u = el)), BytrByte, Wandeln()eln(2) = +u = e Br Ap And, Wandeln()eln(2) = +u = e Br Ap And, Wandeln()eln(2) = +u = e Br Ap And, Wandeln()eln(2) = +a / 16el)), nd,Ap And, Wandeldelln(3) s Then
yte) 8
z = z + 8
Next inReverseAd 3
a iandeln( = z + 8
N2a As Byte
ReDim W Bytrbi Byte
ReDim W Bytr1 And 12
Wanderivate Sub
N2a e<hen
yte) 8
z =nrByte, Wande, es LoEffer ZwissbLong
Dim Zeiu= 0 Tdr - 1
ByteToEtesPerPixel)),"Dim Zeiu= 0 T52r1 Andr ZwisAndr Z
ge As Long)l = +u = e BBandeltandeltandeltandeltandeltaltaseileRox14;gaCht8o=wZeileZndeltander And 32s Wen
rEeDghe1c 16B= Number And 16vs Wen
rEeDghe1c 16B= Number AndTIo8o=mbgDghtrPixel))Aer AndTIo8oZeileZ= Nhto=mbgDht8o=wZo8oo=mbgDht8o=wZo8oo=mbgDht8o=wfe- 1e 0Iffo=mbgDht8o=wZop8oo=mbgDht8o=wZo8oo=m 1e 0I2BytesPSs Long)1e 0I2)2)1e 0I2) t-m 1e nst- - 16B= Number eileRox14;gaCht8o=nEibgDht8o=wZoe8oo=mbgW=eileRober eileRox1=mbgW5,
Forght8
If52MRowByte14;gaCh=nEi> 3eRox1=mbgW5,
Forg 0I
By
R:IaCh=nEs2m3=wZeZeile As L, nst- - 167ndeltandelta>xToZweiBit(Number As Byt 8
z =nr(ref
/EanCopl ahC,Fyp =dci8 AnzRB ▀e The)Fyp W B8\MAeDght8ou= +a / 1,ahC,Fyp =dci8 AnzRB ▀e The)Fyp W B8\MAeDght8ou= +a / 1,ahC,Fyp =dci8 AnzRB ▀e The)Fyp W B
z => + 7)
Filo Men8o=lenbufa B8\8yZeilember AndTIo(3 * Byteesgcing
teestghtI8oo=mbgDhZeio=m 1e 0I2BytesPSs Long)1eTIo(3 * B